fix instantiation
adding missing libraries - lm and lstdc++
Merge pull request #1258 from Yangqing/instantiation

fix instantiation per C++ standard