I finally got my problem fixed, that libstc++ had undefined pthread symbols, even after recompiling. The problem was that make clean did not remove all the old .o files! In library/libio there were some left. I think it was osform.o that was the problem, if I recall correctly. find -name '*.o' | xarg rm; make distclean; configure; make fixed it.