The 5th argument to AC_SEARCH_LIBS is for listing the dependent libraries:
AC_SEARCH_LIBS (function, search-libs, [action-if-found],
[action-if-not-found], [other-libraries])
The other-libraries argument should be a space separated list of flags that will be passed to the linker during tests: eg -lm -lfoo -lbar
See http://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Libraries.html#Libraries