consolidate build rules for object files
automatic discovery of source directories
move cuda output from build/.../.cuo -> build/cuda/.../.o

This will allow nvcc's -M dependency generation option to work
harmoniously, since it assumes that output will have a .o extension.
automatic dependency generation
Merge pull request #1472 from longjon/incremental-build

Makefile improvements: rule consolidation, dependency generation