Force programs to rebuild when a dependency changes

This fixes #353.  I also fixed a few other issues in the Makefile and code generators.