Use TR1 for random number generating

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44653