improved ruby libdir detection for static builds