Sounds like 2 different issues to me...
Transfer case - take a look at the cradle, skid plate, etc bolts and the case itself for loose bolts, cracked mounts etc. Look at the driveshafts, flange bolts, etc.
Lock out Hub - remove inspect for damages teeth, spring, (repair if necessary), grease, replace...