You shouldn't need to fix anything. If your MAMP server's address is 192.168.0.42 (static, not dynamic) then that IP and 'localhost' are for your purposes equivalent as far as the WordPress (wp-config.php) configuration on that MAMP server is concerned, so long as Apache, PHP, MySQL, and WordPress are all on the same machine (Static IP = 192.168.0.42). They aren't equivalent if MySQL is on a separate machine from the Apache, PHP, and WordPress parts. If the IP lets you get a connection, I see no reason why other computers on the network can't access the site. Remember, that address is used by the WordPress software itself, so the connection to the MySQL server is always from the machine with the server running WordPress, and not from the individual machines viewing the site. Hope that makes sense. If it doesn't work that way, I suspect that you have some networking problems. Have you tried to use the IP and found that other computers on the network cannot connect?
From the machine running MAMP, does http://localhost take you to MAMP's web root?