Sort by Matrix Field
You can access the assets field by referencing the matrix field first. myMatrixFieldHandle.assets.  So your entries code would be something like this.

{% set entries = craft.entries.section('menu').limit(3).order('RAND()').relatedTo({
       targetElement: assets,
       field: 'myMatrixFieldHandle.assets'
}) %}