Yoda admits that he's been watching Luke for a long time. In fact, that's how Luke detects Yoda on Dagobah ... he feels like he's being watched. I hypothesize that Yoda's long surveillance of Luke created a two-way connection; that, as Yoda peeked in on Luke's psyche, Luke began to perceive Yoda's environment.
Or maybe he hit his head in the crash landing and wasn't thinking straight.