Fixed AC_CHECK_LIB for pthread and ltokyocabinet.
Fixed implicit declaration warning due to missing header.