It's in Webster's 1913 Dictionary, so it's been around at least that long. Maybe hammer was added kind of from another language; my husband, of German descent, would sometimes call our babies slobber-hanuses when they drooled. Or maybe it started off as ninny-yammering? That would make more sense than ninnies hammering...