People are more than just a physical presence. A person is a memory... an emotion... a moment... a relationship... a connection... and missing someone can exist on any level.
If you are missing the person who is physically next to you, try to ask yourself what about them you are missing.
Do you miss a connection you used to have?
Do you miss a way you used to interact together?
Do you miss a moment you shared (nostalgia)?
Do you miss the person they used to be?
If you find yourself missing the intangible aspects of someone, reminisce! Start up a conversation, and remember what you're longing for together so that the feeling isn't as lonely.
Who knows - maybe they miss themselves, too.