Convert the build system to non-recursive make

Speeds up a no-op build from 500ms to 60ms and significantly improves
dependency tracking.