Set -fPIC for shared library.