Fix issues with linker on OpenBSD

"-rdynamic" doesn't work with GCC 4.7 on OpenBSD: "cc: error:
unrecognized command line option '-rdynamic'". The switch isn't
necessary because it is only a wrapper to "-Wl,--export-dynamic".
Look GCC bug 37454.

The patch also adds some extra libs:
- "crypto" is needed by openssl.
- "GL" and "GLU" is needed by OpenGL libs.
- "curses" is needed by readline.