added the -fPIC argument to gcc as instructed by linker