Add fPIC compile flag and fix warnings.