Murray maintained a more even head to head with Djokovic in the earlier part of their career - it was really only from 2014 onwards that it became very one sided (11-8 to Djokovic up to 2013 which is just over half of their matches, then 14-3 to Djokovic from 2014 onwards). So I don't think you can look at it as Djokovic was never rattled by the matchup, it was clearly in the latter half of their rivalry that Djokovic was not troubled much by him, while in the first half they were closer matched despite Djokovic having the edge. Winning 5/12 matches played in 2011-2013 is pretty good, you wouldn't exactly expect any player to do better against Djokovic in that period (in fact Murray might have the highest winning percentage against Djokovic in that window excluding people that only played him once or twice), so at that time Murray troubled him as much as any player really.
From 2014 onwards, I think Murray never really recovered some of his physical fitness and speed - the level he got back to was still good enough to give him an advantage over the rest of the tour, but against Djokovic who had similar strengths it was more of a problem. Djokovic could handle the long rallies and still outlast Murray, which I think made a difference not just to long matches but to the overall confidence the players had facing each other. Against most players it wouldn't be a disadvantage for Murray to play lots of long rallies or games, but against Djokovic he couldn't afford that. Also at this time Djokovic's serve became more of a weapon, which made it easier to put pressure on Murray's service games. Murray did occasionally change approach and play a lot more aggressively (e.g. US Open 2014) against Djokovic but he could rarely sustain the level needed to beat Djokovic that way for more than a couple of sets. So from 2014 onward he only got wins over Djokovic when he had a significant advantage in form or freshness.
As for what Murray could have done differently, the obvious answer would be to try to be more aggressive and shorten the points, since he couldn't afford to play Djokovic at his own game. Trouble with that is that it's difficult to do on slow HC (where he often played Djokovic in 2014-2017) without all out ball-bashing, and while that can be great if things are clicking, it's horrific if it doesn't. Murray would've probably had to try to adjust to a lower percentage game most of the time rather than trying to just go for it in big finals vs Djokovic. Perhaps that's what he should have done, but then again we will never know if he would have been able to or if he was better off playing to his strengths. Other than that all I can really think is if he could have improved his mental strength against Djokovic - obviously in many matches Djokovic outplayed him but there was room for Murray to get some more wins if he'd been more clutch or not completely imploded. But Djokovic had the mental edge in the matchup in later years, similar to his matches against the Big 3.