Makefile: fix out-of-tree build regression

Because `BUILDDIR` may be an absolute path.
Makefile: fix implicit rule pre-requisite
Makefile: allow `BUILDDIR` to be a relative path
Makefile: build tests in the old way if BUILDDIR is not defined. this fixes a bug introduced by some recent changes by Ole André Vadla Ravnås