Generalize gitignores.

Allows for easier extension building inside a submodule.
Merge pull request #247 from djanowski/patch-1

Generalize gitignores.