Contexts

What is the library that defines the stuff to do with contexts e.g. cuCtxCreate, and where should it be?

Do I need to use -lcuda or something else in my makefile?

All of those driver API functions should be in the cuda library (libcuda.so not sure what it is called on windows or OS X), so if you include cuda.h and link with -lcuda, you should be set.