updated makefiles to incorporate build directory