It has something to do with dynamic linking. It's very odd, and position dependent. I boiled it down to a small test case, involving only one X call (XtAppInitialize). When linked a certain way, it will fail upon execution, but sometimes if you run it right away again, it'll work. The only difference is the order in which the dynamic libs get loaded. I'm running this on an SMP kernel (on a hyperthreaded machine with one CPU) so that may make a difference as well.
So far, I haven't gotten it to fail if I specify these libraries, in this order, on the command line:
gcc -O2 -I/usr/X11R6/include -L/usr/X11R6/lib SUMA_paperplane.c -o SUMA_paperplane -lXt -lGLw -lXm -lGL -lX11 -lXext -lXp -lXmu -lpthread
Note that you can remove some of these libs, and the dynamic loader will sort things out, but it may do it in the wrong order. So a workaround may be to change the Makefile to use this ordering. But can we get some feedback from others with FC4 on different hardware?
P.S. This was with a very stripped down paper airplane program (one line main) so you may have to add a few libraries back.