The BSDs use stdlib.h for alloca(), wrap appropriately.
Build dependency files while building object files

Instead of building dependency files separately use the compiler's -MD
option to build both concurrently. This speeds up the initial build
considerably.