compile fixes, switched to c++11 thread compliant interface
merge