Fixing issues with makefile and dependencies