There are three reasonable interpretations I see. The instruction is clearly to draw a line under something. That something may be whatever is followed by "under", so you underline "the last word in this line". Or "in this line" just narrows it down, so only "the last word" is to be underlined. Or the whole "last word in this line" is meant as an instruction to be interpreted, so it's "line". In that case, be careful not to underline the period, as sentence marks clearly aren't part of a word. Or maybe they are.
Oh wait, it could also refer to "the last 'word' in this line", so you would need to underline "word".