add -fPIC flag (it's needed when compiling on Linux)