The Amazon RDS is marketed as
[...] managing time-consuming database management tasks, freeing you
up to focus on your applications and business.
From one point of view, this is true, it relieves you from a lot of maintenance. On the other hand, it means less flexibility, in our case the lack of access to the filesystem.
The PostgreSQL documentation states:
The CREATE FUNCTION for a user-defined C function must therefore
specify two pieces of information for the function: the name of the
loadable object file, and the C name [...]
As you cannot put files onto the machine, this simply won't work.
If you have to do your work on some AWS platform, you can choose an EC2 instance, which you can basically handle like any other machine you have root access to.