reworked makefile

now calculates dependencies like a proper makefile should