Include stdio.h for snprintf().
Add a space in between >> to make gcc 4.6 happy.
Added Linux pthread support. Drop requirement for c++11.