Proper dependencies for Makefile 

This is not perfect, but speeds things up a lot.