Add initial .gitignore file
Makefile.am: set dependent libraries properly

Ensure dependent libraries are set properly so that:

- parallel builds (e.g., "make -j 32") work properly
- when one library is re-built, the libraries that depend on it are
  re-linked (important for static builds)