OP, as your first IM rotation you will not be expected to have an in-depth knowledge of IM. You will just be expected to show up, try hard, be excited to learn, be a team player, etc. So no need to stress unless your attending is an ass. As you know IM is not very difficult overall to match (though the tip top programs are tough to get) and being well liked by your team rather than your raw knowledge will be more important as a M3, in my opinion. If your attending is cool and you show interest and are a team player your letter and evals will likely be fine. As a M4 you would be expected to know a little more though honestly from my experience expectations are still not very high.
My advice for M3 year would be to take pocket medicine and really study it hard for your patients (obviously you'll also have to have other stuff for the shelf). Know the common diseases and treatments (e.g. HCAP, CHF decompensation, DM management, HTN management, reading basic EKGs, knowing how to apply lab results, etc). Again, from my experience it doesn't start to click and become more intuitive until after step 2 CK studying and then a sub-i and even some other rotations to give more perspective. Think big picture stuff first (getting the right dx) and then more detailed (getting the correct rx) and the work-flow dynamic between the two.
Overall I suggest not setting the bar too terribly high for yourself. And what I mean by that is that after your rotation you not be ready to function at the resident level. It takes many months of learning and practicing in only IM to start to get to that level and a 2 month M3 rotation will not do it. It probably takes most people several months of intern year to start to get "good".