How can a masters student compensate for lack of solid foundation in basic math and CS fundamentals?
That you realize this is good, but the appropriate approach depends on lots of individual factors.  The people who are likely to be able to give you the best advice are your professors/advisor.  They probably know best where you are at and what is most important for you to succeed in their program.  Also, informing them that you are aware of your deficiencies and are trying to make up for them should improve their opinions of you, and also make them more willing to help you succeed in the program.

That said, here are some things that can help: start tutoring or TAing for lower level math/CS classes (I first really understood eigenvectors when I was tutoring other students in linear algebra), going through texts on your own (exercises are the most important!), taking/sitting in on undergrad classes (some of our grad students with weak backgrounds do this), typing up your own notes on this fundamental material, finding people (students or faculty) you can ask specific questions.

Also: read up on the impostor syndrome (on wiki-p and here, say).  You may have it.