Fix shared library generation