Add -pthread option and support C++11 standart