Fixed 'undefined reference to __get_thread' errors.