The Album name needs to be the same for all the files, and the files need to live in the same directory.
Since m4a is of type Video, and flac is of type Audio, you'll need to either configure one of the current Audio view schemes to allow both Media Types, or create your own customized view. It sounds like you might have already done this, but if not, reply back and somebody will explain how. Both are easy enough to do.