remove linking option and use cmakes BUILD_SHARED_LIBS variable