Gem development: Linking against a different library

I am working on a gem that wraps a c library. Call it libA v2. My
question is if it is possible to statically link against libA v2 such
that if libA v1 were installed on the host system, the ruby gem would
still link against libA v2 that is included with the gem.

I found that I am having a hard time specifying which version of the
library to load via the LIBPATH variable when using mkmf. It seems that
mkmf will always generate a Makefile that first searches the default
LD_LIBRARY_PATH for the library not allowing me to specify that I want
libA v2.

Any suggestions?