Get 17 cobblestones and a pickaxe. Make a nice stone cubicle and pick your way out later. Or you could do the same thing after you have dug a mine or make a house with doors. I have a tree house I am developing over my main mine that I will fortify and go to town with.