Gem compilation failing on AIX 64 bit box

Hi I'm trying to compile ruby 64 bit on aix 64 bit box. I configured ruby by enabling libpthread. and compiled the same. But when i try to run ruby setup.rb, i get the following error:

/home/xyz/RUBY_64/lib/ruby/1.8/thread.so: load failed - /lib/ruby/1.8/thread.so (LoadError)         from /home/xyz/RUBY_64/lib/ruby/1.8/thread.rb:5         from /home/xyz/RUBY_64/lib/ruby/site_ruby/1.8/rubygems.rb:85:in `require'         from /home/xyz/RUBY_64/lib/ruby/site_ruby/1.8/rubygems.rb:85         from /home/xyz/RubyAndRelatedGems/7.3/rubygems-0.9.4/./post-install.rb:81:in `require'         from /home/xyz/RubyAndRelatedGems/7.3/rubygems-0.9.4/./post-install.rb:81:in `install_sources'         from /home/xyz/RubyAndRelatedGems/7.3/rubygems-0.9.4/./post-install.rb:116:in `run_hook'         from setup.rb:1526:in `exec_task_traverse'         from setup.rb:1342:in `exec_install'         from setup.rb:1000:in `exec_install'         from setup.rb:814:in `invoke'         from setup.rb:773:in `invoke'         from setup.rb:1578

I've tried the same with ruby -d option and it does not give any more information. Also, ldd on thread.so does not show any dependencies!

any idea?