Add the support for BUILD_WITH_3RD_LIBS