Fix wrong shared library linking

The fix I had proposed for the makefile does not link the shared library properly.