Use pkg-config to detect a system libgit2

We're only compatible with a fairly recent libgit2 though, so we'll probably be
building from source pretty frequently.