Use this as a os2_env.sh
export 'LDFLAGS=-Zomf -Zmap -Zbin-files -Zhigh-mem'
export 'LIBS=-lcx'
Hopefully I got the quoting right, I usually just add them to the configure line. You can use your CFLAGS and CXXFLAGS, the rest should not be needed or already set in config.sys assuming yo rebooted after installing all the development stuff, GCC, libc-devel, libcx-devel, gcc-wlink, gcc-wrc, kbuild-make, (maybe kbuild), os2-base, os2-base-fhs, os2-base-unixtools-path and might as well install the toolkit, os2tk*
libcx is a libc extensions library, contains mmap(), getaddressinfo() and friends.
Make sure you reboot after installing all that to update things like the PATH, need to find *nix versions of some programs first.
You might want to download the source RPM and look at what configure arguments were passed.
Source RPMs are here,
http://rpm.netlabs.org/release/00/i386/SRPMS/ with exp where you'd expect.
Problem is that libc is missing a bunch of terminal stuff making things hard.