-pthread added for thread library