Proper dependency handling in Makefile