No it isn't! I assume that you refer to a group of people which is masculine as long as there's at least one man present. But you can also have a female group of people: las chicas, las amigas, las abuelas. Objects like el libro or la biblioteca don't change their gender, not even in a group.
??? What. No it is not. mujeres are women. The male of women is men (hombres). That gender will not change. In spanish there are some el words (masculine) and some la words(feminine). One of the main things in spanish vocabulary is to always learn whether the word is el or la. There are some general rules but they are hardly universal. Eg we have la pregunta (the question) but el problema (the problem).
La words will take words such as una, esta etc. El words will take words like uno, este etc when needed. Now, English has some words that can mean a person of either gender eg player, teacher, friend.
In Spanish there are some words where changing the last letter signifies the gender. Eg amigo and amiga. Amigo is a male friend but amiga is a female friend. So it is el amigo, la amiga. A group of friends that has only women will always be called las amigas, a group of friends with only male friends will be always called los amigos.
However, if you have a group of friends where some are male and some are female, as long as there is even one male in the group, it will become los amigos.
Note again that this applies to only those words that have a male and a female form i.e. most commonly both -a and -o form. (There might be other forms for some words like estudiante remains same es el estudiante and la estudiante and will follow similar rules but that is besides the point) The words that do not have either a masculine form (eg mujeres) or a feminine form (eg hombres) will not follow that rule.
Now here we have el libro. It is a masculine word. It does not have a feminine form. (Libra is a whole other word that means pound) Therefore for libro it will always be los (not las) libros, muchos (not muchas) lisbros, este (not esta) libro.
I hope that clears things up.