fixed issues with symlinked files by refactoring makefiles