Can you restore the images from the Trash or a recent backup? If not, don't do anything that might write to your disk until you have saved the contents of your disk with recovery software like Disk Drill.
Recovery software should be able to retrieve the image files, but not the deleted libraries.
Where were the libraries located, that you merged into your main library? On an internal or external drive? If external, how is the drive connected? Have you checked the libraries before merging? Did each library work?
canno locate reference or anything
What do you mean? Have you tried to "locate referenced files" and the command is not available? Do you get an error message, that you cannot reconnect managed images? In that case open your Aperture library package (select in Finder, ctrl-click, select "Show Package Contents") and look into the "Masters" folder, if your images are still inside the package. The "Masters" folder is organized by the date of the "Import Session".
Did those libraries reference the same original master image files? Then merging would have imported them as referenced and you may have deleted the library that they are referencing. Another problem exists with merging libraries that contain images imported from Photo Stream. Aperture does not seem to merge Photo stream imported images into other libraries.