Make the random number generator thread safe.
Removes -ffast-math which does not play well with -O3