So grab an old distro and build there, so that you link against
libstdc++.so.5. You're not only going to have trouble with libstdc++,
but also with newer libc's when trying to run a program on an older
system. Going the other way should be less painful: even current
systems typically have a libstdc++.so.5 for legacy code (like yours ;-)
(Although, come to think of it, I vaguely remember some issues with the
tls switch, concerning ctype; I don't know whether that applies any
more.)
A completely static link is another option, given that you don't use any
of those modern features like loadable modules (dlopen), networking/NSS
(gethost* and others) and some other stuff (dunno about threads), as
those features need the dynamic libc at runtime (typically that should
be the same version, I think, for reproducible results).