Added -fPIC flag to all objects

Now all compilation targets use the -fPIC flag (needed for shared objects), whose absence seems to cause problems in some cases.