title: -lm Not linking math library in makefile
body: <p>I know this error has been beaten to death, but I cannot seem to get it to work. I have linked my makefile below:</p>
  
  <pre><code>all: gensine info cs229towav
  
  encode.o: encode.h encode.c
      gcc -c encode.c
  
  write.o: write.c write.h
      gcc -c write.c
  
  gensine.o: encode.c gensine.h gensine.c helper.c write.c
      gcc -c gensine.c -lm
  
  helper.o: helper.c helper.h
      gcc -c helper.c
  
  read.o: read.h read.c
      gcc -c read.c
  
  info.o:read.c info.h info.c decode.c
      gcc -c info.c
  
  decode.o: decode.c decode.h helper.c
      gcc -c decode.c
  
  cs229towav.o: write.c read.c cs229towav.c cs229towav.h helper.c decode.c encode.c
      gcc -c cs229towav.c -lm
  
  gensine: encode.o gensine.o write.o helper.o
      gcc -o gensine encode.o gensine.o write.o helper.o -lm
  
  info: read.o info.o decode.o helper.o
      gcc read.o info.o decode.o helper.o
  
  cs229towav: write.o read.o cs229towav.o decode.o encode.o helper.o
      gcc -o write.o read.o cs229towav.o decode.o encode.o helper.o -lm
  
  Clean:
      rm -rf *o gensine info cs229towav
  </code></pre>
  
  <p>When I run a command such as "make gensine" I am returned with the following result:</p>
  
  <pre><code>&gt;cc gensine.c -o gensine
  /tmp/ccojm09X.o: In function `encodeCsFormat':
  gensine.c:(.text+0x4b1): undefined reference to `sin'
  /tmp/ccojm09X.o: In function `encodeWavFormat':
  gensine.c:(.text+0xa39): undefined reference to `sin'
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>After reading this is says undefined reference to sin, which is with the math library. Those functions listed are in the "encode.c" file which are included in the "gensine.c" file.</p>