Errors encounted when compiling kokkos

Dear users,

I need to compile lammps as a dynamic library. However, I encounted an error like this.

/usr/bin/ld: /home/user/lammps-30Jul16/lib/kokkos/lib/libkokkos.a(Kokkos_Core.o): relocation R_X86_64_32 against `a local symbol’ can not be used when making a shared object; recompile with -fPIC
/home/user/lammps-30Jul16/lib/kokkos/lib/libkokkos.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status

Anyone who could help me with that?

Best,
Xiao