Use MD5 checksums for recompilation checking (fixes #1372, #1959)