You cannot used them as a single shared memory device.
But all you need to cluster any set of computers is an Ethernet switch, and some appropriate software to manage and use a distributed or parallel computing environment. By far the most used OS for that is Linux (and in its day, XServe). There are abundant resources on how to use any set of computers with an eithernet switch to create a Beowulf type cluster. The actual term Beowulf cluster came from the ability to leverage open source Linux and any off the shelf computers to put together a compute cluster. Even furby’s have been used for clusters. You can cluster any Mac computers - Virginia Tech had at one point one of the world’s fastest parallel compute clusters all made from desktop Apple G5 towers (they were using XServe, but could have used a Linux distribution instead).
Exactly how you choose to cluster any set of computers depends entirely on what you intend to use the cluster for, and whether the task(s) you want to run can even be distributed across a cluster (not every problem can be parallelized).
Bottom line though is that creating a cluster isn’t plug and play or point and click.