Makefile: Rewrite to support mtimes and dependencies

The previous version required you to `make && make test` and had actual
targets marked as phonies.