title: How to include -std=c++11 and -lpthread in makefile?
body: <p>I tried the advice in <a href="https://stackoverflow.com/questions/20109453/location-of-lpthread-in-c-makefile">this answer</a>, but it's for GCC and didn't help anyways.</p>
  
  <p>I want to <code>#include &lt;thread&gt;</code> in a file, so I have a make file as the following:</p>
  
  <pre><code>OBJS    = clitest.o Sources/NClient.o
  CC      = g++
  DEBUG   = -g
  CFLAGS  = -Wall -c $(DEBUG)
  LFLAGS  = -Wall $(DEBUG)
  
  clitest: $(OBJS)
      $(CC) $(LFLAGS) $(OBJS) -o clitest
  </code></pre>
  
  <p>Where should I include <code>-std=c++11</code> and <code>-lpthread</code> in this?
  I've tried just about every combination I can, but I continue to get this error when I run <code>make</code>:</p>
  
  <p><code>/usr/include/c++/4.8.3/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.</code></p>
  
  <p>I believe this is the command it's running? </p>
  
  <pre><code>[jaska@localhost NClient]make
  g++    -c -o clitest.o clitest.cpp
  </code></pre>
  
  <p>Here's the source code file, too:</p>
  
  <pre><code>#include &lt;thread&gt;
  #include &lt;string&gt;
  
  void task(std::string msg){
      std::cout &lt;&lt; msg &lt;&lt; '\n';
  }
  
  ...
  ...
  
  std::thread t1(task, "message");
  client-&gt;create();
  t1.join();
  </code></pre>