
There are similarities between the two stories.
1. A ghost speaks to his son and demands his son revenge his murder.
2. The son swears revenge, grandly, and "bemoans the profitless use of his time" (pg 126)
3. Evidently there's a somewhat similar graveside speech in both.
4. The son's mother is in a sexual relationship with the father's murderer.
5. The son kills a man in his mother's chambers, thinking it might be his mother's lover, and the mother is distressed.
This fifth point is the one Margolies considers the most significant. The son in Tom a Lincoln first kills his mother's lover while they were asleep in bed, and then fights with himself and his guilt as to whether it is better to spare his mother's life or to avenge his father's death before killing his mother. Hamlet's mother seems, it has been said to have "fear in excess of any threat Hamlet's anger seems to pose" (pg 127) when she calls out "What wilt thou do? Thou wilt not murder me? / Help, ho!" and this fear could be chalked up to Shakespeare playing with the audiences awareness of this popular work of fiction, where the son did kill his mother in somewhat similar circumstances.
I have no idea how much Shakespeare drew from anything, and when we have no record of what is believed to be his primary source, it becomes even more difficult to say anything about where Shakespeare got his ideas and what he modified. It is very possible, though that Shakespeare took the play Hamlet that was already popular, and played with the similarities and possible similarities of another piece of popular culture to create a great play that has fascinated people for a very long time.