How to get good recommendation when working under a phd student as an undergraduate
As O.R. Mapper notes, this may vary by country. Undergraduates will usually have much less contact with professors than graduate students, because of the sheer numbers of students involved - professors don't have infinite time to meet with each undergrad for an hour every week.

That said, even German professors write letters of recommendation for undergrads once in a while (e.g., for student grants). Usually, they will get their information from the graduate students that do have a lot of contact with the undergrad. For instance, they may ask the grad student to draft the letter of recommendation, then review, improve and sign it. That way, the undergrad gets a recommendation written by someone who actually knows him and may have more time to invest in the letter than a busy professor, and the grad student gets a little experience in writing letters of recommendation (which is a good preparation for later academic life), and everything is done under the supervision of the professor.

Bottom line: your situation is routine. Don't worry. Just do a good job, and your letter will be fine.