title: recompiling with -fPIE flag could not resolve error
body: <p>I am trying to compile <a href="https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-837-computer-graphics-fall-2012/assignments/distrib.zip" rel="nofollow noreferrer">this app</a> using its makefile on WSL. But I get the following error:</p>
  <pre><code>g++ -g -Wall -ansi pendulumSystem.o TimeStepper.o particleSystem.o ClothSystem.o simpleSystem.o camera.o main.o vecmath/src/Vector3f.o vecmath/src/Vector2f.o vecmath/src/Matrix3f.o vecmath/src/Matrix4f.o vecmath/src/Vector4f.o vecmath/src/Quat4f.o vecmath/src/Matrix2f.o -o a3 -L. -lRK4 -lglut -lGL -lGLU
  
  /usr/bin/ld: ./libRK4.a(RK4.o): relocation R_X86_64_32 against symbol `__gxx_personality_v0@@CXXABI_1.3' can not be used when making a PIE object; recompile with -fPIE
  
  /usr/bin/ld: ./libRK4.a(RK4.o): relocation R_X86_64_PC32 against symbol `_Znwm@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIE
  
  /usr/bin/ld: final link failed: bad value
  
  collect2: error: ld returned 1 exit status
  make: *** [Makefile:15: a3] Error 1
  </code></pre>
  <p>I tried editing my makefile to include the flag like below, but it still gives me the same error message.</p>
  <pre><code>INCFLAGS  = -I vecmath/include
  INCFLAGS += -I /usr/include/GL
  
  LINKFLAGS = -L. -lRK4 -lglut -lGL -lGLU
  CFLAGS    = -g -Wall -ansi -fPIE
  CC        = g++
  SRCS      = $(wildcard *.cpp)
  SRCS     += $(wildcard vecmath/src/*.cpp)
  OBJS      = $(SRCS:.cpp=.o)
  PROG      = a3
  
  all: $(SRCS) $(PROG)
  
  $(PROG): $(OBJS)
          $(CC) $(CFLAGS) $(OBJS) -o $@ $(LINKFLAGS)
  
  .cpp.o:
          $(CC) $(CFLAGS) $&lt; -c -o $@ $(INCFLAGS)
  
  depend:
          makedepend $(INCFLAGS) -Y $(SRCS)
  
  clean:
          rm $(OBJS) $(PROG)
  </code></pre>
  <p>Could it be that the provided <code>libRK4.a</code> file was not compiled with the <code>-fPIE</code> flag?</p>