Refactored Makefiles, generate project script now checks if target dir is empty