Clean up the makefiles a bit and make them OBJDIR-safe.