git: fix build on FreeBSD

Our hard-linking code depended on md5sum, which FreeBSD doesn't have in its
system environment. To avoid that impure dependency, the hard-linking is now
done with the 'hardlink' utility from Nixpkgs.