Update Makefile to use environment variables instead of relative paths in .d files

Update Makefile to use environment variables instead of relative paths in .d files