Fix broken for 4-STABLE:
1. ports/math/spooles uses threading, so add pthread explicitly
for 5.1-BETA we don't ever need it.
2. _toupper should be a macro version of subset of toupper.
See the difference between ctype.h of 5.1-BETA and 4-STABLE.
However, I don't see the reason why it cgx uses _toupper (thread safety?).
Pointed out by: kris