Another attempt to fix issue 132. The root cause was php checks tainting global variable (LIBS) on configure script, which propagates to other checks like libboost, libpthreads an so on.