Switch to BUILD_DIR before compiling