Weird 4X4

I have a 2002 ford explorer that recently has started to have temperature related 4 w d issues. When it sits over night and the temp falls below 28 degrees, it mysteriously shifts itself into 4wdlow when it is started and will not shift out till the temp warms up or the battery is un hooked. Is this a controler board issue or shift motor. I have also noticed recently that the 4wd light flashes on and off as well as there are no noises when pushing the 4 wd buttons. It used to make a clicking sound from under the passenger side dash.