Parallel build fixes

Fix module dependencies which are breaking parallel builds. Also, simplify some Makefile rules so that they don't need to duplicate information too much.