Fix if BUILD_SHARED_LIBS is OFF