Fix build out of tree

Just some minor fixes to allow `BUILDDIR` to be an absolute or relative path.