I am assuming your batteries are both 12v so you have a combined 300Ah at 12v, i.e. not only 150Ah from two 6v batteries. So if that is correct, then a 40A alternator is on the low side to really push enough amps to the batteries. There will be times you need to get the batteries charged more completely and if the solar is impaired you will not be able to do so without extended run times. GordMay is correct in that a 40A alternator will not actually put out the full rated juice, and it certainly will not do it after the beginning of the charge process - it will ramp
off dramatically as the batteries fill.
The standard rule
of thumb is the alternator should be rated (nominal not actual) at 25% of amps to Ah of the batteries, so that would be 75A for the alternator. 75A alternators are quite common and easily found but you may have a mounting problem with your particular engine. Usually all you will need is a different mount setup. But there are many base types of mounting for many alternators so you should be able to find one that works. Balmar
is an example.