Fix makefile race condition
Support building from within root directory