It depends on the type of tunnel you are using. If it is the spline track tunnel then you simply raise the ground where you see it or move the entrance further back into the mountain. If it is a tunnel portal object then you need to place a dig hole at the entrance and adjust the area around it to cover any gaps.