-Wl,-flat_namespace workaround, etc.

Hi.

Using ruby-1.9.3, I noticed that the compilation of the ruby bindings fails.

I've fixed it, and made some DRY modifications, etc.

If you don't like this request, feel free to reject it, or tell me to revise it.

Thanks!