How can a student improve his attentiveness during lectures?
In general, if you aren't "pumped up" about major classes and not fully engaged with the lecture, you're probably in the wrong major, however, with some research, you can see that the average attention span of an adult is around 20 minutes, so your situation is totally normal. 

I've struggled with ADD my whole life, so learning how to zone in while I'm zoned out was a full time job for me. I've gotten to the point where I'm pro at being attentive during lectures, here's what I've learned:


Lectures are much more interesting when you apply a purpose for them. For me I'm a computer science major, so what I did was compiled a "reference bible" of useful things that I could use in the future. Another thing I did was continuously develop a game. I tried to incorporate everything I learned into the game, it was pretty much a challenge, so that made programming lectures much more fun. 
Invest in a smart pen. I swear I will never live without one of those things ever again. It kind of forces you pay attention to the lecture so that you can mark important topics down to make it easier to reference. Be carful though, it's easy to get lazy while using it, but just keep in mind that having to listen to a lecture twice isn't fun nor is it a good use of time. 
Force yourself to ask questions. I ask at least 5 questions per hour before the end of a lecture, which for me is a question every 12 minute; well below the average attention span. 
After you do homework, look up the next chapter online. Use everything at your disposal: YouTube tutorials, blogs, research documents, forums, etc. Not only will you be prepared for the next lecture, you'll already know what you're having trouble understanding which is huge, especially for #3. If you're book is outdated and you find new information on a topic, use that to challenge the professor's lecture. Not only will that keep you engaged, it will make you look like you actually care about what they are teaching (hopefully you actually do!) and that you are taking the initiative to activly learn more than just what they are lecturing about; nobody likes a yes-man!


Overall, just getting rid of distractions never did it for me, so the way I bought of it is "solve the root of the problem, not the effects," because technology is a great thing to have when used correctly, so give yourself a reason to pay attention. Hopefully this helps!