Fixing dependency resolution in Makefile