add pthread to compilation