Updated the Makefile to embed R and started working on td_r.cpp file.