Fixed the linking failure problem for some distribution.

In Archlinux the building will be failure because of the pthread linking problem:

```
/usr/bin/ld: beansdb-beansdb.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
```

I added a new libraries searching line into `configure.ac` for searching and linking pthread.