Use pthread on linux, as suggested by Matevz