Improve Makefile to prevent dir error when first compiled