Use AC_CHECK_FUNC rather than AC_LINK_IFELSE.

It does the same thing, only with less eye pain.