specify <std> only if run as c++ and link

Signed-off-by: Kohei Takahashi <flast@flast.jp>