Use ACX_PTHREAD macro for configuring PTHREADS
Fix issue #180
Fix warning due to uninitialized variable
Fix warning due to a wrong format specifier for printf