Fix wrong shared library linking

The current call to gcc in the makefile can't link the shared library properly. When linking against a static library, only unresolved symbols will be pulled in.