autotools: FreeBSD support

This patch adds FreeBSD and pkg-config support to configure.ac. The pkg-config support is somewhat dependent on https://github.com/strophe/libstrophe/pull/37, but degrades nicely to the original behavior.

Some of the code was re-used from https://github.com/strophe/libstrophe/pull/22.
This comment is useless in this place now. Remove it or move to the "false" branch of PKG_CHECK_MODULES().