Fix detection of unset BUILDDIR var