Do not use AC_CHECK_LIB anyway. Use AC_LINK_IFELSE instead.