Re-apply Makefile changes. Fix build with srcdir != objdir.