teb_local_planner is available to install through
sudo apt install ros-kinetic-teb-local-planner
If it in not the case for you, it should be easier.
To build it anyway, try to use
-j 1 option:
catkin_make -j 1
This will force compiler to use only single thread for compilation. Build process will take more time, but will release some memory.