for some reason -lpthreads on some machines needs to be at the end of the directive and on other machines it needs to be at the begining