https://answers.ros.org/question/303209/slow-build-time/
“I've replicated your problem. It's hanging on the linking step, but you can fix it by adding ${catkin_LIBRARIES} to the target_link_libraries command for costmap-2d_cloud and markers. Not sure why yet, but I'm going to investigate and make a PR.”
REF: https://github.com/ros-planning/navigation/pull/800 -- for other ROS version