Clean up as much as possible between runs

Make sure we have a clean build dir before configure/make/make check.

Also, report the result of "git reset --hard" in the log.