Create static and shared libs

Add -fPIC to CFLAGS, position independent code required by shared libs.