Restrict .gitignore

User more absolute paths, especially for generic names which also appear
in folders which should be tracked (e.g. `lib`).
Add missed file