configure: libffi after pthread

On OpenBSD, for example, the libffi link test doesn't work until
"-pthread" is in $LIBS.

Also, make `configure' complain if `--enable-libffi' is specified
and linking to libffi fails.