Added env. variable to specify the number of threads [gh#300]