When using precompiled headers with gcc, add -fPIC only if building shared libraries