Add a better autoconf check for libevent.