How to run the OpenCL sample codes?

Hello,

I am new to OpenCL and trying to run the sample code from nvidia ‘OpenCL device query’ available here (https://developer.nvidia.com/opencl) on ubuntu 12.04

I get a lots of undefined reference for:
std::basic_string
shrLogEx
shrLog
shrSetLogFileName

when I try the makefile, I get errors:
‘\r’ command not found
shell: command not found
ifeq($(dbg),1)

I understand that this is a very basic doubt but could anyone please let me know how to run these sample codes?