Start cleaning up the build

Delete intermediate and output files, and add a .gitignore file.  Add
Makefile rules to rebuild libraries even if directories already exist.
Finish cleaning up build