Some thing like this.
install:
echo 'installing node js'
git clone git://github.com/ry/node.git
cd node
./configure
make
sudo make install
cd ..
echo 'install npm'
sudo curl -L https://npmjs.org/install.sh | sh
echo 'installing mocha, chai ... .'
Here is the version of makefile that should work for you,
install:
echo 'installing node js'
git clone git://github.com/ry/node.git
cd node; \
./configure; \
make; \
sudo make install