make it work on centos and with correct flag to share the library