Makefile creation to install a custom package

Hello everyone!
I am trying to make a custom package of a library I need on my OpenWrt system. I have successfully compiled the library with the OpenWrt toolchain but I have some issues in writing the Makefile to make it a package.
I have followed the guide example here is for a simple executable application helloworld and I couldn't manage to apply it to a whole library.
In the Makefile writing I am having some problem with the definition of the build/compile part.
To be specific I have used the following commands to compile the application on my PC obtaining the compiled and linked version suitable for OpenWrt:

cmake /home/marta/vanetza \
    -DCMAKE_TOOLCHAIN_FILE=/home/marta/vanetza/cmake/Toolchain-x86.cmake \
    -DCMAKE_FIND_ROOT_PATH=/home/marta/vanetza-deps \

and I am not sure on how to translate it in the make file in order to specify everything as happened in the guide Makefile in the following lines:

$(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/helloworld.o -c $(PKG_BUILD_DIR)/helloworld.c

Do you have any idea on how to solve this issue?
Do you think is possible to have another way to install the library on the system avoiding the passage through the package?
Thank you in advance for your time and help!