There is many different mount available for mounting a scope to your AR15 flat top. ARMS mount as mentioned by Vinnie is an excellent choice, a choice made many times over by the military users. Also you can find 30mm one piece mount from Colt , Eagle, or even just getting a steel target grade high rings from makers such as GG&G, Badger, or Precision Reflex, etc, etc,...
40 mm objective lens is not a big scope by any standard in today's market, 50 to 56 mm has been amking head ways for awhile, and with the mounting solution suggested above, you should have no problem getting the proer mount for your 40mm, and also a good cheek contact to your stock.
Good luck.