Link heartbeat_test with the static version of the libraries

It's using an internal API that that might not be available in the shared
library.