added test for cuda
made makefile a little more responsible