make it thread-safe
updated Makefile
updated travis.yml