Use pkg-config where available or detect the library using AC_LIB_HAVE_LINKFLAGS.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>