Add dependency handling in Makefiles