If it was making noise when you're sitting still but the engine running it is unlikely to be the transfer case, wheel bearings, brake related (like rock stuck in the caliper), differentials, driveshaft u-joints.
Could be something on the input side of the transmission, like a torque converter...