Change configure to allow statically linking libpcre.

Statically linking libpcre requires using -lpthread, which is added
when building Suricata, but not while checking for libpcre in configure.