The song is in C major. Melody is in C major pentationic (1-2-3-5-6) adding the IV. Chord progression is: I-V-ii-IV-V.
What do you do?
The pentatonic mode as well as the IV-V-I turnaround strongly suggest blues. So let's try the old Chuck Berry 1-5-6 riff. The drummer is not playing a shuffle, more of a straight 4/4, but harmonically it fits so we'll just shift the feel around a little to fit the groove. So, now how do we fit the riff to the chord progression? This groove is really working, lets try just modulating the riff to follow the progression. The I is good. The V is good. The IV is good. Back to the V is good - well of course they are, this is a blues riff and that's the blues progression. But the ii - that's a minor chord, and the minor diatonic scale uses a flat 6th which screws up the intervals. But the flat 6th of the ii is a flat 7 of the I, which isn't in the primary key major diatonic and also isn't in the mode of the melody. But if we keep the same intervals, and play the natural 6 that gives us the natural 7 of the main key, which really isn't very bluesy and also isn't in the mode of the melody.
What would James Jamerson do? Keep playing the riff - the groove is killing. Play the natural (sharp) 6 - no one is touching the natural 7 or the flat 7 so it's not going to rub too badly against anything else - and if you do it with perfect phrasing and timing no one will even notice that you just went way out of the main harmony because you are such a bad-a$$.