Added phtreads to the linker to try to work around this bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42159