Go back to shared and properly install libgit2

libgit2 is shared, so we need to set LD_LIBRARY_PATH anyway.