This is what we do in MacPorts: https://trac.macports.org/browser/trunk/dports/graphics/glew/files/config_Makefile.darwin.patch...
You have to use ARFLAGS=crs (rather than just cr) when creating universal archives....
Fix build failure on OS X < 10.7
Fix compiling with opaque ncurses
Link libcunit against curses lib when curses is enabled
Patch for doc/headers/Makefile.am
An additional patch is needed for doc/headers. I’m attaching both.