Isolate the pain of building threaded (and statically linked) event
system programs. Build two versions of the event library, one for non threaded programs and another (libevent_r.a) for threaded versions. Remove all that -pthread goo from all of the makefiles, except for the scheduler (which is threaded); it gets linked as before, but with -levent_r instead. If you try and use the threaded API without the proper link, the library will print an error message and quit.